﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PhotoGallery.DLL;
using PhotoGallery.Model;
namespace PhotoGallery.BLL
{
    public class RegistAction
    {
        UserDataAccess uda = new UserDataAccess();
        /*
            注册的主方法
         */
        public void regist(String username,String password,String nickname) 
        {
            
            uda.insert(username, password, nickname);
        }
        /*
         * 判断用户是否存在
         */
        public bool isExist(String username) {
            if (uda.searchUserByUsername(username) == null)
                return false;
            else
                return true;
        }

        public bool isNickExist(String nickname)
        {
            if (uda.searchUserByNickname(nickname) == null)
                return false;
            else
                return true;
        }
    }
}
